import React,{Component} from "react";
import "./que_detail.css"
class Que_detail extends React.Component{

    constructor(props) {
        super(props);
        this.state = {
            question:"BAT中的B是什么？",
            answer:[
                {
                    author:"Mary",
                    ans:"是一家企业"
                },{
                    author:"Mary",
                    ans:"Baidu"
                },{
                    author:"Mary",
                    ans:"是搜索引擎"
                },{
                    author:"Mary",
                    ans:"是中国的一家企业"
                }
            ]
        }
    }

    render() {
        return (
            <div>
                <div className="container question">{this.state.question}</div>
                {
                    this.state.answer.map((item,index)=>{
                        return(
                            <div className="container answer">
                                <div className="name">{item.author}</div>
                                <div className="ans">{item.ans}</div>
                            </div>
                        )
                    })
                }
            </div>
        );
    }

}

export default Que_detail;